home *** CD-ROM | disk | FTP | other *** search
- /////////////////////////////////////////////////
- // Huffman decoder header file huffdec.h
- // Copyright (c) 1991 Azarona Software
- // All rights reserved.
- /////////////////////////////////////////////////
-
- #ifndef H_HUFFDEC
- #define H_HUFFDEC
-
- #include <stdio.h>
-
- struct tree_node {
- int left, right;
- };
-
- class huff_decoder {
- protected:
- int cbyte; // Current byte to decode
- int cbit; // Current bit of byte
- int num_symbols; // Number of symbols
- tree_node *tree; // Where the code tree is
- FILE *fin; // The file we're coming from
- long text_locn; // Start of text in file
- public:
- huff_decoder(void) { ; }
- int connect(FILE *f, long locn);
- void reset(void);
- void reset(long locn);
- int get_input_char(void) { return fgetc(fin); }
- int get_bits(int nbits);
- int get_next_char(void);
- void build_tree(long locn);
- long tlocn(void) { return text_locn; }
- };
-
- #endif
-